
#ifndef __Logger_h
#define __Logger_h

// Qt includes
#include <QObject>

// HMP includes
#include <Pimpl.h>
#include "hcore_global.h"
#include "ILogger.h"

#define LOG_FATAL(x) Logger::GetInstance()->fatal(x);
#define LOG_CRITICAL(x) Logger::GetInstance()->critical(x);
#define LOG_ERROR(x) Logger::GetInstance()->error(x);
#define LOG_WARN(x) Logger::GetInstance()->warning(x);
#define LOG_INFO(x) Logger::GetInstance()->info(x);
#define LOG_NOTICE(x) Logger::GetInstance()->notice(x);

class LoggerPrivate;
class QFile;

/// \deprecated This class was a wrapper around Log4Qt. Since Log4Qt dependency has been
/// removed, it is advised to use qDebug(), qWarning() and qCritical() instead.
/// \ingroup Core
class HCORESHARED_EXPORT Logger : public QObject,public ILogger
{
  Q_OBJECT
public:
  typedef QObject Superclass;
  /// Default mode is Off
  ///
  ///
  static Logger* GetInstance();

  virtual ~Logger ();

  void debug(const char *msg);
  void info(const char* msg);
  void notice(const char* msg) override;
  void warning(const char* msg) override;
  void error(const char* msg) override;
  void critical(const char* msg) override;
  void fatal(const char* msg) override;
  void information(const char* msg) override;

protected:
  QScopedPointer<LoggerPrivate> d_ptr;

private:
  explicit Logger(QObject* parent = 0);
  Q_DECLARE_PRIVATE(Logger);
  Q_DISABLE_COPY(Logger);
};

#endif
